<!DOCTYPE html>
<html>
<head>
    <title>春芽活动表</title>
    #parse("sys/header.html")
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <Row :gutter="16">
            <i-col span="4">
                <i-input v-model="q.name" @on-enter="query" placeholder="名称"/>
            </i-col>
            <i-button @click="query">查询</i-button>
            <i-button type="primary" @click="activityRecord"><i class="fa fa-map"></i>&nbsp;报名记录</i-button>

            <div class="buttons-group">
                #if($shiro.hasPermission("activity:save"))
                <i-button type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
                #end
                #if($shiro.hasPermission("activity:update"))
                <i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
                #end
                #if($shiro.hasPermission("activity:delete"))
                <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
                #end
            </div>
        </Row>
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>

    <Card v-show="!showList">
        <p slot="title">{{title}}</p>
        <i-form ref="formValidate" :model="activity" :rules="ruleValidate" :label-width="80">
            <Form-item label="活动名称" prop="title">
                <i-input v-model="activity.title" placeholder="活动名称"/>
            </Form-item>
            <Form-item label="活动简介" prop="brief">
                <textarea v-model="activity.brief" placeholder="活动简介" :rows="4" style ="width:100%;"></textarea>
            </Form-item>
            <Form-item label="封面图" prop="listCoverUrl">
                <i-col span="16">
                    <i-input v-model="activity.listCoverUrl" placeholder="列表封面图" readonly/>
                </i-col>
                <i-col span="3">
                    <Form-item :label-width="1">
                        <Upload style="width: 300px;" action="../sys/oss/upload" :format="['jpg','jpeg','png']"
                                max-size="2048"
                                :on-success="handleSuccessPicUrl" :on-format-error="handleFormatError"
                                :show-upload-list="false"
                                :on-exceeded-size="handleMaxSize">
                            <i-button icon="ios-cloud-upload-outline">上传图片</i-button>
                        </Upload>
                    </Form-item>
                </i-col>
                <i-col span="3">
                    <Form-item :label-width="1">
                        <i-button icon="eye" @click="eyeImagePicUrl">预览图片</i-button>
                    </Form-item>
                </i-col>
            </Form-item>
            <Form-item label="举办城市" prop="activityCity">
                <i-input v-model="activity.activityCity" placeholder="活动举办城市"/>
            </Form-item>
            <Form-item label="开始时间" prop="activityStartTime">
                <Date-picker  type="datetime" v-model="activity.activityStartTime"
                             placeholder="活动开始时间"></Date-picker>
            </Form-item>
            <Form-item label="结束时间" prop="activityEndTime">
                <Date-picker type="datetime" v-model="activity.activityEndTime"
                             placeholder="活动结束时间"></Date-picker>
            </Form-item>
            <Form-item label="具体地点" prop="activityPlace">
                <i-input v-model="activity.activityPlace" placeholder="活动具体地点"/>
            </Form-item>
            <Form-item label="获取经纬度">
                <a href="http://www.gpsspg.com/maps.htm" target="_blank">在线地图经度纬度查询，请选择腾讯地图的经纬度，保留后六位小数，纬度范围:0-90.000000,经度范围:0-180.000000</a>
            </Form-item>
            <Form-item label="纬度" prop="latitude">
                <i-input v-model="activity.latitude" placeholder="请选择腾讯地图的纬度"/>
                <!--<Input-number style="width: 188px;" :min="0.000001" :step="0.000001" v-model="" placeholder="请选择腾讯地图的纬度"/>-->
            </Form-item>
            <Form-item label="经度" prop="longitude">
                <i-input v-model="activity.longitude" placeholder="请选择腾讯地图的经度"/>
                <!--<Input-number style="width: 188px;" :min="0.000001" :step="0.000001" v-model="activity.longitude" placeholder="请选择腾讯地图的经度"/>-->
            </Form-item>
            <Form-item label="活动详情" prop="contentDesc">
                <div id="contentDesc"></div>
            </Form-item>
            <Form-item label="标签" prop="tags">
                <i-input v-model="activity.tags" placeholder="标签(多个请用英文逗号隔开)"/>
            </Form-item>
            <Form-item label="是否已结束" prop="isFinish">
                <Radio-group v-model="activity.isFinish">
                    <Radio label="1">
                        <span>是</span></Radio>
                    <Radio label="0">
                        <span>否</span></Radio>
                </Radio-group>
            </Form-item>
            <Form-item>
                <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
                <i-button type="warning" @click="reload" style="margin-left: 8px"/>
                返回</i-button>
                <i-button type="ghost" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
            </Form-item>
        </i-form>
    </Card>
</div>

<script src="${rc.contextPath}/js/shop/activity.js?_${date.systemTime}"></script>
</body>
</html>